<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>数据表设计 | 美多商城</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../C03-Goods/FastDFS.html" />
    
    
    <link rel="prev" href="../C03-Goods/index.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.1"
        data-chapter-title="数据表设计"
        data-filepath="C03-Goods/DatabaseDesign.md"
        data-basepath=".."
        data-revision="Thu May 24 2018 15:58:46 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        美多商城
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="C01-Prepare/index.html">
            
                
                    <a href="../C01-Prepare/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        项目准备
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="C01-Prepare/BusinessModel.html">
            
                
                    <a href="../C01-Prepare/BusinessModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        商业模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="C01-Prepare/DevelopmentProcess.html">
            
                
                    <a href="../C01-Prepare/DevelopmentProcess.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        开发流程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="C01-Prepare/ProductAnalysis.html">
            
                
                    <a href="../C01-Prepare/ProductAnalysis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        需求分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="C01-Prepare/ProjectStructure.html">
            
                
                    <a href="../C01-Prepare/ProjectStructure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        项目架构
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="C01-Prepare/StartProject.html">
            
                
                    <a href="../C01-Prepare/StartProject.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        创建工程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="C01-Prepare/Config.html">
            
                
                    <a href="../C01-Prepare/Config.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        配置
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="C02-Users/index.html">
            
                
                    <a href="../C02-Users/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        用户部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="C02-Users/UserModel.html">
            
                
                    <a href="../C02-Users/UserModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        用户模型类
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="C02-Users/Register.html">
            
                
                    <a href="../C02-Users/Register.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        注册
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="C02-Users/CORS.html">
            
                
                    <a href="../C02-Users/CORS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        跨域CORS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="C02-Users/JWT.html">
            
                
                    <a href="../C02-Users/JWT.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        JWT
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="C02-Users/DRF-JWT.html">
            
                
                    <a href="../C02-Users/DRF-JWT.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        Django REST framework JWT
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="C02-Users/Login.html">
            
                
                    <a href="../C02-Users/Login.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        登录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="C02-Users/FindPassword/index.html">
            
                
                    <a href="../C02-Users/FindPassword/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        找回密码
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.7.1" data-path="C02-Users/FindPassword/Step1.html">
            
                
                    <a href="../C02-Users/FindPassword/Step1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.1.</b>
                        
                        第一步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7.2" data-path="C02-Users/FindPassword/Step2.html">
            
                
                    <a href="../C02-Users/FindPassword/Step2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.2.</b>
                        
                        第二步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7.3" data-path="C02-Users/FindPassword/Step3.html">
            
                
                    <a href="../C02-Users/FindPassword/Step3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.3.</b>
                        
                        第三步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7.4" data-path="C02-Users/FindPassword/Step4.html">
            
                
                    <a href="../C02-Users/FindPassword/Step4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.4.</b>
                        
                        第四步
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="C02-Users/QQLogin/index.html">
            
                
                    <a href="../C02-Users/QQLogin/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        QQ登录
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.8.1" data-path="C02-Users/QQLogin/Step1.html">
            
                
                    <a href="../C02-Users/QQLogin/Step1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.1.</b>
                        
                        第一步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8.2" data-path="C02-Users/QQLogin/Step2.html">
            
                
                    <a href="../C02-Users/QQLogin/Step2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.2.</b>
                        
                        第二步
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8.3" data-path="C02-Users/QQLogin/Step3.html">
            
                
                    <a href="../C02-Users/QQLogin/Step3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.3.</b>
                        
                        第三步
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="C02-Users/UserInfo.html">
            
                
                    <a href="../C02-Users/UserInfo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        用户中心个人信息
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="C02-Users/Email/index.html">
            
                
                    <a href="../C02-Users/Email/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        邮件与验证
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="C02-Users/Email/DjangoEmail.html">
            
                
                    <a href="../C02-Users/Email/DjangoEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.1.</b>
                        
                        Django发送邮件的方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10.2" data-path="C02-Users/Email/SendEmail.html">
            
                
                    <a href="../C02-Users/Email/SendEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.2.</b>
                        
                        保存邮箱并发送验证邮件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10.3" data-path="C02-Users/Email/VerifyEmail.html">
            
                
                    <a href="../C02-Users/Email/VerifyEmail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.3.</b>
                        
                        验证邮箱链接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="C02-Users/Address/index.html">
            
                
                    <a href="../C02-Users/Address/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        收货地址
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.11.1" data-path="C02-Users/Address/AreaSelect.html">
            
                
                    <a href="../C02-Users/Address/AreaSelect.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.1.</b>
                        
                        省市区地址查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11.2" data-path="C02-Users/Address/Cache.html">
            
                
                    <a href="../C02-Users/Address/Cache.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.2.</b>
                        
                        使用缓存
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11.3" data-path="C02-Users/Address/UserAddressManagement.html">
            
                
                    <a href="../C02-Users/Address/UserAddressManagement.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.3.</b>
                        
                        用户地址管理
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="C03-Goods/index.html">
            
                
                    <a href="../C03-Goods/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        商品部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="3.1" data-path="C03-Goods/DatabaseDesign.html">
            
                
                    <a href="../C03-Goods/DatabaseDesign.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        数据表设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="C03-Goods/FastDFS.html">
            
                
                    <a href="../C03-Goods/FastDFS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        FastDFS分布式文件系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="C03-Goods/Docker/index.html">
            
                
                    <a href="../C03-Goods/Docker/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Docker使用
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1" data-path="C03-Goods/Docker/Introduce.html">
            
                
                    <a href="../C03-Goods/Docker/Introduce.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.1.</b>
                        
                        Docker简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.2" data-path="C03-Goods/Docker/InstallAndOperations.html">
            
                
                    <a href="../C03-Goods/Docker/InstallAndOperations.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.2.</b>
                        
                        安装与操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="C03-Goods/FastDFSDocker.html">
            
                
                    <a href="../C03-Goods/FastDFSDocker.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        使用Docker安装FastDFS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="C03-Goods/FastDFSClientAndDjangoFileSystem.html">
            
                
                    <a href="../C03-Goods/FastDFSClientAndDjangoFileSystem.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        FastDFS客户端与自定义文件存储系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="C03-Goods/CKEditor.html">
            
                
                    <a href="../C03-Goods/CKEditor.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        CKEditor富文本编辑器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="C03-Goods/ImportGoodsData.html">
            
                
                    <a href="../C03-Goods/ImportGoodsData.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        添加测试数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="C03-Goods/FreezeHTML.html">
            
                
                    <a href="../C03-Goods/FreezeHTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        页面静态化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="C03-Goods/DjangoCrontab.html">
            
                
                    <a href="../C03-Goods/DjangoCrontab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        定时任务
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="C03-Goods/GenerateIndexHTMLScript.html">
            
                
                    <a href="../C03-Goods/GenerateIndexHTMLScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        静态化首页的手动脚本
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="C03-Goods/GoodsDetail.html">
            
                
                    <a href="../C03-Goods/GoodsDetail.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        商品详情页面
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="C03-Goods/HotSaleGoods.html">
            
                
                    <a href="../C03-Goods/HotSaleGoods.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        热销商品
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="C03-Goods/UserBrowseHistory.html">
            
                
                    <a href="../C03-Goods/UserBrowseHistory.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        用户浏览历史记录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.14" data-path="C03-Goods/GoodsList.html">
            
                
                    <a href="../C03-Goods/GoodsList.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        商品列表页
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="C03-Goods/GoodsSearch.html">
            
                
                    <a href="../C03-Goods/GoodsSearch.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.15.</b>
                        
                        商品搜索
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="C04-Cart/index.html">
            
                
                    <a href="../C04-Cart/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        购物车部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="C04-Cart/DataStructureDesign.html">
            
                
                    <a href="../C04-Cart/DataStructureDesign.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        购物车数据存储设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="C04-Cart/Implement.html">
            
                
                    <a href="../C04-Cart/Implement.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        购物车实现
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="C04-Cart/MergeCart.html">
            
                
                    <a href="../C04-Cart/MergeCart.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        登录合并购物车
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="C05-Order/index.html">
            
                
                    <a href="../C05-Order/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        订单部分
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="C05-Order/OrderDBModel.html">
            
                
                    <a href="../C05-Order/OrderDBModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        订单数据库设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="C05-Order/PlaceOrder.html">
            
                
                    <a href="../C05-Order/PlaceOrder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        订单结算
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="C05-Order/SaveOrder.html">
            
                
                    <a href="../C05-Order/SaveOrder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        保存订单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="C05-Order/OrderSuccess.html">
            
                
                    <a href="../C05-Order/OrderSuccess.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        下单成功
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="C06-Pay/index.html">
            
                
                    <a href="../C06-Pay/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        支付宝支付
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="C06-Pay/Alipay.html">
            
                
                    <a href="../C06-Pay/Alipay.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        接入支付宝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="C06-Pay/Paying.html">
            
                
                    <a href="../C06-Pay/Paying.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        发起支付
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="C06-Pay/PaymentResult.html">
            
                
                    <a href="../C06-Pay/PaymentResult.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        保存支付结果
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="C07-Xadmin.html">
            
                
                    <a href="../C07-Xadmin.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        Xadmin
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="C08-Permission.html">
            
                
                    <a href="../C08-Permission.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        用户权限控制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9" data-path="C09-Database/index.html">
            
                
                    <a href="../C09-Database/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        数据库读写分离
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="C09-Database/MasterSlave.html">
            
                
                    <a href="../C09-Database/MasterSlave.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        主从同步配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="C09-Database/ReadWriteSeparate.html">
            
                
                    <a href="../C09-Database/ReadWriteSeparate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.2.</b>
                        
                        Django数据库读写分离
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" data-path="C10-Deploy.html">
            
                
                    <a href="../C10-Deploy.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        Django部署
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >美多商城</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x6570;&#x636E;&#x5E93;&#x8868;&#x8BBE;&#x8BA1;">&#x6570;&#x636E;&#x5E93;&#x8868;&#x8BBE;&#x8BA1;</h1>
<p>&#x5728;&#x7535;&#x5546;&#x4E2D;&#x5BF9;&#x4E8E;&#x5546;&#x54C1;&#xFF0C;&#x6709;&#x4E24;&#x4E2A;&#x91CD;&#x8981;&#x7684;&#x6982;&#x5FF5;&#xFF1A;<strong>SPU</strong>&#x548C;<strong>SKU</strong></p>
<ul>
<li><p><strong>SPU  =  Standard Product Unit  &#xFF08;&#x6807;&#x51C6;&#x4EA7;&#x54C1;&#x5355;&#x4F4D;&#xFF09;</strong></p>
<p>SPU&#x662F;&#x5546;&#x54C1;&#x4FE1;&#x606F;&#x805A;&#x5408;&#x7684;&#x6700;&#x5C0F;&#x5355;&#x4F4D;&#xFF0C;&#x662F;&#x4E00;&#x7EC4;&#x53EF;&#x670D;&#x7528;&#x3001;&#x6613;&#x68C0;&#x7D22;&#x7684;&#x6807;&#x51C6;&#x5316;&#x4FE1;&#x606F;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x8BE5;&#x96C6;&#x5408;&#x63CF;&#x8FF0;&#x4E86;&#x4E00;&#x4E2A;&#x4EA7;&#x54C1;&#x7684;&#x7279;&#x6027;&#x3002;</p>
<p>&#x901A;&#x4FD7;&#x7684;&#x8BB2;&#xFF0C;&#x5C5E;&#x6027;&#x503C;&#x3001;&#x7279;&#x6027;&#x76F8;&#x540C;&#x7684;&#x5546;&#x54C1;&#x5C31;&#x53EF;&#x4EE5;&#x79F0;&#x4E3A;&#x4E00;&#x4E2A;SPU&#x3002;</p>
<p>&#x4F8B;&#x5982;:</p>
<p>iPhone X &#x5C31;&#x662F;&#x4E00;&#x4E2A;SPU&#xFF0C;&#x4E0E;&#x5546;&#x5BB6;&#x3001;&#x989C;&#x8272;&#x3001;&#x6B3E;&#x5F0F;&#x3001;&#x89C4;&#x683C;&#x3001;&#x5957;&#x9910;&#x7B49;&#x90FD;&#x65E0;&#x5173;&#x3002;</p>
</li>
<li><p><strong>SKU  =  Stock Keeping Unit  &#xFF08;&#x5E93;&#x5B58;&#x91CF;&#x5355;&#x4F4D;&#xFF09;</strong></p>
<p>SKU&#x5373;&#x5E93;&#x5B58;&#x8FDB;&#x51FA;&#x8BA1;&#x91CF;&#x7684;&#x5355;&#x4F4D;&#xFF0C;&#x53EF;&#x4EE5;&#x662F;&#x4EE5;&#x4EF6;&#x3001;&#x76D2;&#x3001;&#x6258;&#x76D8;&#x7B49;&#x4E3A;&#x5355;&#x4F4D;&#xFF0C;&#x662F;&#x7269;&#x7406;&#x4E0A;&#x4E0D;&#x53EF;&#x5206;&#x5272;&#x7684;&#x6700;&#x5C0F;&#x5B58;&#x8D27;&#x5355;&#x5143;&#x3002;&#x5728;&#x4F7F;&#x7528;&#x65F6;&#x8981;&#x6839;&#x636E;&#x4E0D;&#x540C;&#x4E1A;&#x6001;&#xFF0C;&#x4E0D;&#x540C;&#x7BA1;&#x7406;&#x6A21;&#x5F0F;&#x6765;&#x5904;&#x7406;&#x3002;&#x5728;&#x670D;&#x88C5;&#x3001;&#x978B;&#x7C7B;&#x5546;&#x54C1;&#x4E2D;&#x4F7F;&#x7528;&#x6700;&#x591A;&#x6700;&#x666E;&#x904D;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF1A;</p>
<p>iPhone X &#x5168;&#x7F51;&#x901A;&#x9ED1;&#x8272;256G &#x5C31;&#x662F;&#x4E00;&#x4E2A;SKU&#xFF0C;&#x8868;&#x793A;&#x4E86;&#x5177;&#x4F53;&#x7684;&#x89C4;&#x683C;&#x3001;&#x989C;&#x8272;&#x7B49;&#x4FE1;&#x606F;&#x3002;</p>
</li>
</ul>
<h2 id="&#x8868;&#x7ED3;&#x6784;">&#x8868;&#x7ED3;&#x6784;</h2>
<h4 id="&#x5546;&#x54C1;&#x6570;&#x636E;&#x8868;&#x7ED3;&#x6784;">&#x5546;&#x54C1;&#x6570;&#x636E;&#x8868;&#x7ED3;&#x6784;</h4>
<p><img src="../images/&#x5546;&#x54C1;&#x6570;&#x636E;&#x5E93;&#x8868;&#x7ED3;&#x6784;.png" alt="&#x5546;&#x54C1;&#x6570;&#x636E;&#x5E93;&#x8868;&#x7ED3;&#x6784;"></p>
<h4 id="&#x9996;&#x9875;&#x5E7F;&#x544A;&#x6570;&#x636E;&#x8868;&#x7ED3;&#x6784;">&#x9996;&#x9875;&#x5E7F;&#x544A;&#x6570;&#x636E;&#x8868;&#x7ED3;&#x6784;</h4>
<p><img src="../images/&#x9996;&#x9875;&#x5E7F;&#x544A;&#x6570;&#x636E;&#x5E93;&#x7ED3;&#x6784;.png" alt="&#x9996;&#x9875;&#x5E7F;&#x544A;&#x6570;&#x636E;&#x8868;&#x7ED3;&#x6784;"></p>
<h2 id="&#x6570;&#x636E;&#x5E93;&#x6A21;&#x578B;&#x7C7B;">&#x6570;&#x636E;&#x5E93;&#x6A21;&#x578B;&#x7C7B;</h2>
<p>&#x521B;&#x5EFA;&#x5546;&#x54C1;&#x5E94;&#x7528;goods&#xFF0C;&#x5546;&#x54C1;&#x6570;&#x636E;&#x6A21;&#x578B;&#x7C7B;</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">GoodsCategory</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5546;&#x54C1;&#x7C7B;&#x522B;
    &quot;&quot;&quot;</span>
    name = models.CharField(max_length=<span class="hljs-number">10</span>, verbose_name=<span class="hljs-string">&apos;&#x540D;&#x79F0;&apos;</span>)
    parent = models.ForeignKey(<span class="hljs-string">&apos;self&apos;</span>, null=<span class="hljs-keyword">True</span>, blank=<span class="hljs-keyword">True</span>, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;&#x7236;&#x7C7B;&#x522B;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_goods_category&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5546;&#x54C1;&#x7C7B;&#x522B;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.name


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">GoodsChannel</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5546;&#x54C1;&#x9891;&#x9053;
    &quot;&quot;&quot;</span>
    group_id = models.IntegerField(verbose_name=<span class="hljs-string">&apos;&#x7EC4;&#x53F7;&apos;</span>)
    category = models.ForeignKey(GoodsCategory, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;&#x9876;&#x7EA7;&#x5546;&#x54C1;&#x7C7B;&#x522B;&apos;</span>)
    url = models.CharField(max_length=<span class="hljs-number">50</span>, verbose_name=<span class="hljs-string">&apos;&#x9891;&#x9053;&#x9875;&#x9762;&#x94FE;&#x63A5;&apos;</span>)
    sequence = models.IntegerField(verbose_name=<span class="hljs-string">&apos;&#x7EC4;&#x5185;&#x987A;&#x5E8F;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_goods_channel&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5546;&#x54C1;&#x9891;&#x9053;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.category.name


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Brand</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x54C1;&#x724C;
    &quot;&quot;&quot;</span>
    name = models.CharField(max_length=<span class="hljs-number">20</span>, verbose_name=<span class="hljs-string">&apos;&#x540D;&#x79F0;&apos;</span>)
    logo = models.ImageField(verbose_name=<span class="hljs-string">&apos;Logo&#x56FE;&#x7247;&apos;</span>)
    first_letter = models.CharField(max_length=<span class="hljs-number">1</span>, verbose_name=<span class="hljs-string">&apos;&#x54C1;&#x724C;&#x9996;&#x5B57;&#x6BCD;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_brand&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x54C1;&#x724C;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.name


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Goods</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5546;&#x54C1;SPU
    &quot;&quot;&quot;</span>
    name = models.CharField(max_length=<span class="hljs-number">50</span>, verbose_name=<span class="hljs-string">&apos;&#x540D;&#x79F0;&apos;</span>)
    brand = models.ForeignKey(Brand, on_delete=models.PROTECT, verbose_name=<span class="hljs-string">&apos;&#x54C1;&#x724C;&apos;</span>)
    category1 = models.ForeignKey(GoodsCategory, on_delete=models.PROTECT, related_name=<span class="hljs-string">&apos;cat1_goods&apos;</span>, verbose_name=<span class="hljs-string">&apos;&#x4E00;&#x7EA7;&#x7C7B;&#x522B;&apos;</span>)
    category2 = models.ForeignKey(GoodsCategory, on_delete=models.PROTECT, related_name=<span class="hljs-string">&apos;cat2_goods&apos;</span>, verbose_name=<span class="hljs-string">&apos;&#x4E8C;&#x7EA7;&#x7C7B;&#x522B;&apos;</span>)
    category3 = models.ForeignKey(GoodsCategory, on_delete=models.PROTECT, related_name=<span class="hljs-string">&apos;cat3_goods&apos;</span>, verbose_name=<span class="hljs-string">&apos;&#x4E09;&#x7EA7;&#x7C7B;&#x522B;&apos;</span>)
    sales = models.IntegerField(default=<span class="hljs-number">0</span>, verbose_name=<span class="hljs-string">&apos;&#x9500;&#x91CF;&apos;</span>)
    comments = models.IntegerField(default=<span class="hljs-number">0</span>, verbose_name=<span class="hljs-string">&apos;&#x8BC4;&#x4EF7;&#x6570;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_goods&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5546;&#x54C1;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.name


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">GoodsSpecification</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5546;&#x54C1;&#x89C4;&#x683C;
    &quot;&quot;&quot;</span>
    goods = models.ForeignKey(Goods, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;&#x5546;&#x54C1;&apos;</span>)
    name = models.CharField(max_length=<span class="hljs-number">20</span>, verbose_name=<span class="hljs-string">&apos;&#x89C4;&#x683C;&#x540D;&#x79F0;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_goods_specification&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5546;&#x54C1;&#x89C4;&#x683C;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;%s: %s&apos;</span> % (self.goods.name, self.name)


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SpecificationOption</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x89C4;&#x683C;&#x9009;&#x9879;
    &quot;&quot;&quot;</span>
    spec = models.ForeignKey(GoodsSpecification, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;&#x89C4;&#x683C;&apos;</span>)
    value = models.CharField(max_length=<span class="hljs-number">20</span>, verbose_name=<span class="hljs-string">&apos;&#x9009;&#x9879;&#x503C;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_specification_option&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x89C4;&#x683C;&#x9009;&#x9879;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;%s - %s&apos;</span> % (self.spec, self.value)


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKU</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5546;&#x54C1;SKU
    &quot;&quot;&quot;</span>
    name = models.CharField(max_length=<span class="hljs-number">50</span>, verbose_name=<span class="hljs-string">&apos;&#x540D;&#x79F0;&apos;</span>)
    caption = models.CharField(max_length=<span class="hljs-number">100</span>, verbose_name=<span class="hljs-string">&apos;&#x526F;&#x6807;&#x9898;&apos;</span>)
    goods = models.ForeignKey(Goods, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;&#x5546;&#x54C1;&apos;</span>)
    category = models.ForeignKey(GoodsCategory, on_delete=models.PROTECT, verbose_name=<span class="hljs-string">&apos;&#x4ECE;&#x5C5E;&#x7C7B;&#x522B;&apos;</span>)
    price = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">2</span>, verbose_name=<span class="hljs-string">&apos;&#x5355;&#x4EF7;&apos;</span>)
    cost_price = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">2</span>, verbose_name=<span class="hljs-string">&apos;&#x8FDB;&#x4EF7;&apos;</span>)
    market_price = models.DecimalField(max_digits=<span class="hljs-number">10</span>, decimal_places=<span class="hljs-number">2</span>, verbose_name=<span class="hljs-string">&apos;&#x5E02;&#x573A;&#x4EF7;&apos;</span>)
    stock = models.IntegerField(default=<span class="hljs-number">0</span>, verbose_name=<span class="hljs-string">&apos;&#x5E93;&#x5B58;&apos;</span>)
    sales = models.IntegerField(default=<span class="hljs-number">0</span>, verbose_name=<span class="hljs-string">&apos;&#x9500;&#x91CF;&apos;</span>)
    comments = models.IntegerField(default=<span class="hljs-number">0</span>, verbose_name=<span class="hljs-string">&apos;&#x8BC4;&#x4EF7;&#x6570;&apos;</span>)
    is_launched = models.BooleanField(default=<span class="hljs-keyword">True</span>, verbose_name=<span class="hljs-string">&apos;&#x662F;&#x5426;&#x4E0A;&#x67B6;&#x9500;&#x552E;&apos;</span>)
    default_image_url = models.CharField(max_length=<span class="hljs-number">200</span>, default=<span class="hljs-string">&apos;&apos;</span>, null=<span class="hljs-keyword">True</span>, blank=<span class="hljs-keyword">True</span>, verbose_name=<span class="hljs-string">&apos;&#x9ED8;&#x8BA4;&#x56FE;&#x7247;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_sku&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5546;&#x54C1;SKU&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;%s: %s&apos;</span> % (self.id, self.name)


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUImage</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x56FE;&#x7247;
    &quot;&quot;&quot;</span>
    sku = models.ForeignKey(SKU, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;sku&apos;</span>)
    image = models.ImageField(verbose_name=<span class="hljs-string">&apos;&#x56FE;&#x7247;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_sku_image&apos;</span>
        verbose_name = <span class="hljs-string">&apos;SKU&#x56FE;&#x7247;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;%s %s&apos;</span> % (self.sku.name, self.id)


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SKUSpecification</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    SKU&#x5177;&#x4F53;&#x89C4;&#x683C;
    &quot;&quot;&quot;</span>
    sku = models.ForeignKey(SKU, on_delete=models.CASCADE, verbose_name=<span class="hljs-string">&apos;sku&apos;</span>)
    spec = models.ForeignKey(GoodsSpecification, on_delete=models.PROTECT, verbose_name=<span class="hljs-string">&apos;&#x89C4;&#x683C;&#x540D;&#x79F0;&apos;</span>)
    option = models.ForeignKey(SpecificationOption, on_delete=models.PROTECT, verbose_name=<span class="hljs-string">&apos;&#x89C4;&#x683C;&#x503C;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_sku_specification&apos;</span>
        verbose_name = <span class="hljs-string">&apos;SKU&#x89C4;&#x683C;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;%s: %s - %s&apos;</span> % (self.sku, self.spec.name, self.option.value)
</code></pre>
<p>&#x521B;&#x5EFA;&#x5E7F;&#x544A;&#x5185;&#x5BB9;&#x5E94;&#x7528;contents&#xFF0C;&#x5E7F;&#x544A;&#x6570;&#x636E;&#x6A21;&#x578B;&#x7C7B;</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ContentCategory</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5E7F;&#x544A;&#x5185;&#x5BB9;&#x7C7B;&#x522B;
    &quot;&quot;&quot;</span>
    name = models.CharField(max_length=<span class="hljs-number">50</span>, verbose_name=<span class="hljs-string">&apos;&#x540D;&#x79F0;&apos;</span>)
    key = models.CharField(max_length=<span class="hljs-number">50</span>, verbose_name=<span class="hljs-string">&apos;&#x7C7B;&#x522B;&#x952E;&#x540D;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_content_category&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5E7F;&#x544A;&#x5185;&#x5BB9;&#x7C7B;&#x522B;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.name


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Content</span><span class="hljs-params">(BaseModel)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;
    &#x5E7F;&#x544A;&#x5185;&#x5BB9;
    &quot;&quot;&quot;</span>
    category = models.ForeignKey(ContentCategory, on_delete=models.PROTECT, verbose_name=<span class="hljs-string">&apos;&#x7C7B;&#x522B;&apos;</span>)
    title = models.CharField(max_length=<span class="hljs-number">100</span>, verbose_name=<span class="hljs-string">&apos;&#x6807;&#x9898;&apos;</span>)
    url = models.CharField(max_length=<span class="hljs-number">300</span>, verbose_name=<span class="hljs-string">&apos;&#x5185;&#x5BB9;&#x94FE;&#x63A5;&apos;</span>)
    image = models.ImageField(null=<span class="hljs-keyword">True</span>, blank=<span class="hljs-keyword">True</span>, verbose_name=<span class="hljs-string">&apos;&#x56FE;&#x7247;&apos;</span>)
    text = models.TextField(null=<span class="hljs-keyword">True</span>, blank=<span class="hljs-keyword">True</span>, verbose_name=<span class="hljs-string">&apos;&#x5185;&#x5BB9;&apos;</span>)
    sequence = models.IntegerField(verbose_name=<span class="hljs-string">&apos;&#x6392;&#x5E8F;&apos;</span>)
    status = models.BooleanField(default=<span class="hljs-keyword">True</span>, verbose_name=<span class="hljs-string">&apos;&#x662F;&#x5426;&#x5C55;&#x793A;&apos;</span>)

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Meta</span>:</span>
        db_table = <span class="hljs-string">&apos;tb_content&apos;</span>
        verbose_name = <span class="hljs-string">&apos;&#x5E7F;&#x544A;&#x5185;&#x5BB9;&apos;</span>
        verbose_name_plural = verbose_name

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__str__</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> self.category.name + <span class="hljs-string">&apos;: &apos;</span> + self.title
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../C03-Goods/index.html" class="navigation navigation-prev " aria-label="Previous page: 商品部分"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../C03-Goods/FastDFS.html" class="navigation navigation-next " aria-label="Next page: FastDFS分布式文件系统"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
